home *** CD-ROM | disk | FTP | other *** search
- ////////////////////////////////////////////////////////////////
- // All the data about a gopher item (type, hostname, filename, port)
- // is kept in this object.
-
- #import "GopherBrowserCell.h"
-
- @implementation GopherBrowserCell
-
- - setTextAttributes:textObj
- {
- [super setTextAttributes:textObj];
-
- switch (Type) {
- case '0' : // Document
- break;
- case '1' : // Directory
- break;
- case '2': // CSO Nameserver
- [textObj setTextGray:NX_WHITE];
-
- break;
- case '7' : // Index
- // [textObj setBackgroundGray:NX_BLACK]; // Useless: background not used
- [textObj setTextGray:NX_WHITE];
- break;
- case 'T':
- case 'R':
- case '8' : // Telnet
- break;
- case 's' : // Sound
- break;
- default :
- break;
- }
-
- return self;
- }
-
- /////////////////////////////////////////////////////////////
-
- - setRemoteName:(char *)name
- {
- strncpy(RemoteName, name,511);
- return self;
- }
-
- - (char *)remoteName
- {
- return RemoteName;
- }
-
- - setRemoteHost:(char *)name
- {
- strncpy(RemoteHost, name, 128);
- return self;
- }
-
- - (char *)remoteHost
- {
- return RemoteHost;
- }
-
- - setRemotePort:(int)port
- {
- RemotePort = port;
- return self;
- }
-
- - (int)remotePort
- {
- return RemotePort;
- }
-
- - setCellType:(char)type
- {
- id myFont;
-
- Type = type;
-
- switch (Type)
- {
- case '0' : // Document
- break;
- case '1' : // Directory
- break;
- case '2': // CSO Nameserver
- // myFont = [Font newFont:"Times-Italic" size:14.0];
- // [self setFont:myFont];
- break;
- case '7' : // Index
- break;
- case 'R': // Rlogin
- case 'T': // TN3270
- case '8' : // Telnet
- myFont = [Font newFont:"Courier" size:12.0];
- [self setFont:myFont];
- break;
- case 's' : // Sound
- myFont = [Font newFont:"Times-Italic" size:12.0];
- [self setFont:myFont];
- break;
- default :
- break;
- }
-
- return self;
- }
-
- - (char)cellType
- {
- return Type;
- }
-
- @end
-